﻿@{
    ViewBag.Title = "ProjectInfo";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@using DepartmentWork.Model
@model DepartmentWork.Model.ProjectDevelopInfoViewModel
    <link href="~/Assets/plugins/bootstrap-select/bootstrap-select.min.css" rel="stylesheet" />
    <script src="~/Assets/plugins/bootstrap-select/bootstrap-select.min.js"></script>

<link href="~/Assets/plugins/bootstrap-datepicker/css/datepicker3.css" rel="stylesheet" />
<link href="~/Assets/plugins/bootstrap-datepicker/css/datepicker-theme.css" rel="stylesheet" />
<script src="~/Assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script src="~/Assets/plugins/chosen/chosen.jquery.min.js"></script>
<script src="~/Assets/js/pages/form-elements.js"></script>
    <style>
        .btn-default {
            color: #333;
            background-color: #FFF;
            border-color: #CCC;
            height: 34px;
        }
    </style>

<div class="page-header">
    <div class="pull-left">
        <ol class="breadcrumb visible-sm visible-md visible-lg">
            <li><a href="@Url.Action("Index","Home",new{area=""})"><i class="icon fa fa-home"></i>主页</a></li>
            <li><a href="@Url.Action("Index","Home",new{area="DevelopArea"})"><i class="fa fa-envelope"></i>开发模块</a></li>
            <li class="active"><a href="#"><i class="fa fa-envelope"></i>项目详情</a></li>
        </ol>
    </div>
</div>


@{
    if (ViewBag.Flag == "True")
    {
      <div class="alert alert-success">
	    <button type="button" class="close" data-dismiss="alert">×</button>
	    <strong>&emsp;@ViewBag.FlagInfo！</strong> 
      </div>
    }
    if (ViewBag.Flag == "False")
    {
      <div class="alert alert-danger">
	    <button type="button" class="close" data-dismiss="alert">×</button>
	    <strong>&emsp;操作失败！</strong> @ViewBag.FlagInfo
    </div>
    }
}

<div class="row" style="margin: 0 auto">
    <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12" style="width: 25%">
        <div class="panel bk-widget bk-border-off bk-noradius">
            <div class="bk-border-warning bk-bg-white bk-fg-warning bk-ltr bk-padding-15">
                <div class="row">
                    <div class="col-xs-4 text-left bk-vcenter bk-padding-off">
                        <span class="bk-round bk-icon bk-icon-3x bk-bg-warning bk-border-off">
                            <i class="fa fa-database fa-3x"></i>
                        </span>
                    </div>
                    <div class="col-xs-8 text-center bk-vcenter">
                        <a href="@Url.Action("ProjectTaskBookList", "TaskBook", new { area = "DevelopArea",projectId=this.Model.ProjectDevelopId})">
                            <h3 style="color:black;"  class="bk-margin-off">任务书</h3>
                            <h4 style="color:black;"  class="bk-margin-off">@this.Model.TaskBookCount</h4>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12" style="width: 25%">
        <div class="panel bk-widget bk-border-off">
            <div class="bk-border-success bk-bg-white bk-fg-success bk-ltr bk-padding-15">
                <div class="row">
                    <div class="col-xs-4 text-left bk-vcenter bk-padding-off">
                        <span class="bk-round bk-border-off bk-icon bk-icon-3x bk-bg-success">
                            <i class="fa fa-file-o fa-3x"></i>
                        </span>
                    </div>
                    <div class="col-xs-8 text-center bk-vcenter">
                        <a href="@Url.Action("ProjectTaskList", "Task", new { area = "DevelopArea" ,projectId=this.Model.ProjectDevelopId})">
                            <h3 style="color:black;"  class="bk-margin-off">任务</h3>
                            <h4 style="color:black;"  class="bk-margin-off">@this.Model.TaskCount</h4>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12" style="width: 25%">
        <div class="panel bk-widget bk-border-off bk-noradius">
            <div class="bk-border-danger bk-bg-white bk-fg-danger bk-ltr bk-padding-15">
                <div class="row">
                    <div class="col-xs-4 text-left bk-vcenter bk-padding-off">
                        <span class="bk-round bk-border-off bk-icon bk-icon-3x bk-bg-danger">
                            <i class="fa fa-exclamation  fa-3x"></i>
                        </span>
                    </div>
                    <div class="col-xs-8 text-center bk-vcenter">
                        <a href="@Url.Action("ProjectBugList", "Bug", new { area = "DevelopArea" ,projectId=this.Model.ProjectDevelopId })">
                            <h3  style="color:black;" class="bk-margin-off">BUG</h3>
                            <h4  style="color:black;" class="bk-margin-off">@this.Model.BugCount</h4>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-3 col-md-6 col-sm-6 col-xs-12" style="width: 25%">
        <div class="panel bk-widget bk-border-off bk-noradius">
            <div class="bk-border-info bk-bg-white bk-fg-info bk-ltr bk-padding-15">
                <div class="row">
                    <div class="col-xs-4 text-left bk-vcenter bk-padding-off">
                        <span class="bk-round bk-border-off bk-icon bk-icon-3x bk-border-info">
                            <i class="fa fa-inbox fa-3x"></i>
                        </span>
                    </div>
                    <div class="col-xs-8 text-center bk-vcenter">
                        <a href="@Url.Action("ProjectDocumentList", "Document", new { area = "DevelopArea" ,projectId=this.Model.ProjectDevelopId })">
                            <h3 style="color:black;" class="bk-margin-off">文档</h3>
                            <h4  style="color:black;"  class="bk-margin-off">@this.Model.DocumentCount</h4>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="col-md-8 col-xs-12" style="width: 70%">
    <div class="panel bk-widget bk-border-off bk-noradius">
        <div class="panel">
            <div class="panel-heading bk-bg-primary">
                <h6><i class="fa fa-table red"></i><span class="break"></span>项目简况</h6>
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-bordered">
                        <tbody>
                            <tr>
                                <td style="width: 15%"><b>项目名称:</b></td>
                                <td style="width: 35%" data-project-field="name">@this.Model.ProjectDevelopName</td>
                                <td style="width: 15%"><b>项目编号:</b></td>
                                <td style="width: 35%" data-project-field="no">@this.Model.ProjectDevelopNo</td>
                            </tr>


                            <tr>
                                <td><b>项目负责人:</b></td>
                                <td data-project-field="owner">@this.Model.ProjectDevelopLeaders</td>
                                <td><b>项目人员:</b></td>
                                <td data-project-field="user">@this.Model.ProjectDevelopEmpolees</td>
                            </tr>
                            <tr>
                                <td><b>创建日期:</b></td>
                                <td>@this.Model.ProjectDevelopCreateTime.ToString("yyyy-MM-dd")</td>
                                <td><b>预计完成日期:</b></td>
                                <td data-project-field="deadline">@this.Model.ProjectDevelopDeadTime.ToString("yyyy-MM-dd")</td>
                            </tr>



                            <tr>
                                <td><b>业务联系部门:</b></td>
                                <td data-project-field="department">@this.Model.ProjectDevelopBusinessDepartment</td>
                                <td><b>业务类型:</b></td>
                                <td data-project-field="bussiness">@this.Model.ProjectDevelopBusinessType</td>
                            </tr>

                            <tr>
                                <td><b>业务联系人:</b></td>
                                <td data-project-field="contact">@this.Model.ProjectDevelopBusinessContact</td>
                                <td><b>联系电话:</b></td>
                                <td data-project-field="tel">@this.Model.ProjectDevelopBusinessTel</td>

                            </tr>


                            <tr>
                                <td><b>隶属团队空间:</b></td>
                                <td colspan="3">@this.Model.ProjectDevelopInTeamsapceName</td>

                            </tr>


                            <tr>
                                <td><b>项目描述:</b></td>
                                <td colspan="3" data-project-field="description">@this.Model.ProjectDevelopDescription</td>
                            </tr>
                            <tr>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="col-lg-4 col-md-12"  style="width: 30%;float:right">
    <div class="panel panel-default">
        <div class="panel-heading bk-bg-white">
            <h4><b>项目操作</b></h4>
            <div class="panel-actions">
                <a href="#" class="btn-minimize"><i class="fa fa-caret-up"></i></a>
                <a href="#" class="btn-close"><i class="fa fa-times"></i></a>
                
            </div>
        </div>
        <div class="panel-body bk-noradius">
            <div class="bk-bg-white bk-padding-off-top bk-padding-off-bottom">
                <div class="row">

                    <div class="col-xs-9 bk-vcenter">
                        <span>当前项目状态：<b style="color:firebrick">@this.Model.ProjectDevelopStatus</b></span>
                        @{
                            if (ViewBag.IsDevelopLeader==true)
                            {
                              <a data-toggle="modal" data-target="#editProjectModal">
                                <h4 class="bk-fg-primary bk-fg-darken bk-margin-off-bottom" style="cursor: pointer">项目编辑</h4>
                              </a>
                            }
                        }

                    </div>
                </div>
            </div>
            <hr class="bk-margin-off">
            <div class="bk-bg-white bk-padding-off-top bk-padding-off-bottom">
                <div class="row">
                    <div class="col-xs-9 bk-vcenter">
                         @{
                            if (ViewBag.IsDevelopLeader==true)
                            {
                                <a data-toggle="modal" data-target="#changeProjectStateModal">
                                    <h4 class="bk-fg-primary bk-fg-darken bk-margin-off-bottom" style="cursor: pointer">项目状态操作</h4>
                                </a>
                            }
                        }
                      
                    </div>
                </div>
            </div>
            <hr class="bk-margin-off">
        </div>
    </div>
</div>
@{
    if (ViewBag.IsDevelopLeader == true)
    {
      <div class="col-lg-4 col-md-12"   style="width: 30%;float:right">
        <div class="panel panel-default">
            <div class="panel-heading bk-bg-white">
                <h4><b>人员管理</b></h4>
                <div class="panel-actions">
                    <a href="#" class="btn-minimize"><i class="fa fa-caret-up"></i></a>
                    <a href="#" class="btn-close"><i class="fa fa-times"></i></a>
                </div>
            </div>
            <div class="panel-body bk-noradius" style="padding-top: 0px;">
                <a class="bk-bg-white bk-padding-off-top bk-padding-off-bottom">
                    <div class="row">

                        <div class="col-xs-9 bk-vcenter">
                        
                            <a data-toggle="modal" data-target="#changeProjectLeaderModal">
                                <h4 class="bk-fg-primary bk-fg-darken bk-margin-off-bottom" style="cursor: pointer">项目组长转岗</h4>
                            </a>
                        </div>
                    </div>
                </a>
                <hr class="bk-margin-off">
                <a class="bk-bg-white bk-padding-off-top bk-padding-off-bottom">
                    <div class="row">

                        <div class="col-xs-9 bk-vcenter">
                            <a data-toggle="modal" data-target="#changeProjectEmpModal">
                                <h4 class="bk-fg-primary bk-fg-darken bk-margin-off-bottom" style="cursor: pointer">项目人员调整</h4>
                            </a>
                        </div>
                    </div>
                </a>
                <hr class="bk-margin-off">
            </div>
        </div>
    </div>
    }
}







<!-- 模态框（Modal） -->

<div class="modal fade" id="editProjectModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

    <script>

        window.onload = function ()
        {
            $("#datetimepicker").datepicker({
                autoclose: true,
                pickerPosition: "bottom-right"
            });
        };
    </script>

    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">编辑项目
                </h4>
            </div>
            <form id="frm_ProjectEdit" method="POST" action="@Url.Action("EditProject", "Project", new { area = "DevelopArea" })">
                <div class="modal-body">
                    <input type="hidden" name="hid_ProjectId" value="@this.Model.ProjectDevelopId"/>
                    <div class="row">
                        <label class="col-md-3 control-label" for="text-input">项目名称</label>
                        <div class="col-md-9">
                            <input name="tb_ProjectName" value="@this.Model.ProjectDevelopName" style="border-color: cornflowerblue" class="form-control" placeholder="Text" type="text">
                        </div>
                    </div>
                    <br />



                    <div class="row">
                        <label class="col-md-3 control-label">截至日期：</label>
                        <div class="col-md-9">
                            <div class="input-append date" id="datetimepicker" data-date="@this.Model.ProjectDevelopDeadTime.ToString("yyyy-MM-dd")" data-date-format="yyyy-mm-dd">
                                <input name="tb_ProjectDeadTime" style="border-color: cornflowerblue" class="form-control" size="16" type="text" value="@this.Model.ProjectDevelopDeadTime.ToString("yyyy-MM-dd")">
                                <span class="add-on"><i class="icon-th"></i></span>
                            </div>

                        </div>
                    </div>

                    <br />

                    <div class="row">
                        <label class="col-md-3 control-label" for="text-input">功能描述：</label>
                        <div class="col-md-9">
                            <textarea id="tb_ProjectDescription" name="tb_ProjectDescription" rows="5" class="form-control" placeholder="Content..">@this.Model.ProjectDevelopDescription</textarea>
                        </div>
                    </div>

                    <br />

                    <div class="row">
                        <label class="col-md-3 control-label" for="text-input">业务主管部门：</label>
                        <div class="col-md-9">
                            <input value="@this.Model.ProjectDevelopBusinessDepartment" name="tb_ProjectBusinessDepartment" class="form-control" placeholder="Text" type="text">
                        </div>
                    </div>
                    <br />

                    <div class="row">
                        <label class="col-md-3 control-label" for="text-input">业务联系人：</label>
                        <div class="col-md-9">
                            <input value="@this.Model.ProjectDevelopBusinessContact" name="tb_ProjectBusinessContact" class="form-control" placeholder="Text" type="text">
                        </div>
                    </div>
                    <br />

                    <div class="row">
                        <label class="col-md-3 control-label" for="text-input">业务联系人电话：</label>
                        <div class="col-md-9">
                            <input  name="tb_ProjectBusinessTel" value="@this.Model.ProjectDevelopBusinessTel" class="form-control" placeholder="Text" type="text">
                        </div>
                    </div>
                    <br />
                    
                    <div class="row">
                        <label class="col-md-3 control-label">项目级别：</label>
                        <div class="col-md-9"  style="height: 34px">

                            <select name="select_ProjectLevel" class="form-control select2-active">
                                <option value="Low">低</option>
                                <option value="Normal">中</option>
                                <option value="High">高</option>
                            </select>
                        </div>
                    </div>
                    <br />
                    <div class="row">
                        <label class="col-md-3 control-label">业务类型：</label>
                        <div class="col-md-9">

                            <select name="select_BusinessType" class="form-control select2-active">
                                <option value="办公">办公</option>
                                <option value="政法">政法</option>
                                <option value="关税">关税</option>
                                <option value="监管">监管</option>
                                <option value="加贸">加贸</option>
                                <option value="行邮">行邮</option>
                                <option value="统计">统计</option>
                                <option value="稽查">稽查</option>
                                <option value="缉私">缉私</option>
                                <option value="财务">财务</option>
                                <option value="人教">人教</option>
                                <option value="监察">监察</option>
                                <option value="关保">关保</option>
                                <option value="政工">政工</option>
                                <option value="督审">督审</option>
                                <option value="科技">科技</option>
                                <option value="其他">其他</option>
                            </select>
                        </div>
                    </div>

                    <br />

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        关闭
                    </button>
                    <input type="button" onclick="SubmitEdit()" class="btn btn-primary" value="提交更改"/>
                </div>
            </form>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal -->
</div>
<script>
    function SubmitEdit()
    {
        if ($("#tb_ProjectDescription").text().length > 200) {
            return false;
        }
        $("#frm_ProjectEdit").submit();
    }
</script>




<!-- 模态框（Modal） -->

<div class="modal fade" id="changeProjectLeaderModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel1">项目组长转岗
                </h4>
            </div>
            <form method="POST" action="@Url.Action("EditProjectLeader", "Project")">
                <div class="modal-body">
                    <input type="hidden" name="hid_ProjectId" value="@this.Model.ProjectDevelopId"/>
                    <div class="row">
                        <br />
                        <label class="col-md-3 control-label">项目组长：</label>
                        <div class="col-md-9">

                            <select name="select_ProjectLeader" id="select_ProjectLeader" class="form-control selectpicker"
                                    multiple="multiple">
                                @{
                                    List<UserInfoViewModel> userList = (List<UserInfoViewModel>)TempData["UserList"];
                                    if (userList != null)
                                    {
                                        for (int i = 0; i < userList.Count(); i++)
                                        {
                                            var item = userList[i];
                                            if (item.IsProjectLeader == "True")
                                            {
                                                    <option selected="selected" value="@item.UserId">@item.UserName</option>
                                            }
                                            else
                                            {
                                                    <option value="@item.UserId">@item.UserName</option>
                                            }
                                        }
                                    }
                                    }
                                </select>
                        </div>
                    </div>

                    <br />

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        关闭
                    </button>
                    <input type="submit" class="btn btn-primary" value="提交更改"/>
                </div>
            </form>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal -->
</div>


<!-- 模态框（Modal） -->

<div class="modal fade" id="changeProjectEmpModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">


    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel1">项目人员修改
                </h4>
            </div>
            <form action="@Url.Action("EditProjectEmployee", "Project")" method="POST">
                <div class="modal-body">
                     <input type="hidden" name="hid_ProjectId" value="@this.Model.ProjectDevelopId"/>
                    <div class="row">
                        <br />
                        <label class="col-md-3 control-label">项目人员：</label>
                        <div class="col-md-9">

                            <select name="select_ProjectEmp" id="select_ProjectEmp" class="form-control selectpicker"
                                    multiple="multiple">
                                @{
                                    if (userList != null)
                                    {
                                        for (int i = 0; i < userList.Count(); i++)
                                        {
                                            var item = userList[i];
                                            if (item.IsProjectLeader == "True")
                                            {
                                                    <option selected="selected" value="@item.UserId">@item.UserName</option>
                                            }
                                            else
                                            {
                                                    <option value="@item.UserId">@item.UserName</option>
                                            }
                                        }
                                    }
                                    }
                                </select>
                        </div>
                    </div>

                    <br />

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        关闭
                    </button>
                    <input type="submit" class="btn btn-primary" value="提交更改"/>
                </div>
            </form>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal -->
</div>



<!-- 模态框（Modal） -->

<div class="modal fade" id="changeProjectStateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">


    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel2">项目状态操作
                </h4>
            </div>
            <form action="@Url.Action("EditProjectStatus", "Project")" method="POST">
                <div class="modal-body">
                    <input type="hidden" name="hid_ProjectId" value="@this.Model.ProjectDevelopId"/>
                    <div class="row">
                        <br />
                        <label class="col-md-3 control-label">项目状态操作：</label>
                        <div class="col-md-9">

                            <select name="select_ProjectStatus" class="form-control select2">
                                <option value="0">进行中</option>
                                <option value="1">完成</option>
                            </select>
                        </div>
                    </div>

                    <br />

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        关闭
                    </button>
                    <input type="submit" class="btn btn-primary" value="提交更改"/>
                </div>
            </form>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal -->
</div>
